//
// OpenTemplate
// Copyright (c) 2006
// by OpenArrow Software ( http://www.openarrow.com )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 
// to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions 
// of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
// DEALINGS IN THE SOFTWARE.
//

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;
using OpenArrow.Templating.Properties;

namespace OpenArrow.Templating
{
    /// <summary>
    /// Represents an error or warning that occurred during the execution of an activity
    /// </summary>
    [Serializable()]
    public class Problem
    {
        /// <summary>
        /// Error that occurs when an input file does not exist (OTC0001)
        /// </summary>
        /// <param name="fileName">The file that does not exist</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0001"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_InputFileDoesNotExist(string fileName)
        { return NewError(String.Format(Resources.Error_InputFileDoesNotExist, fileName), -1, -1, "OTC0001"); }

        /// <summary>
        /// Error that occurs when an invalid character is found in a directive name (OTC0002)
        /// </summary>
        /// <param name="c">The invalid character</param>
        /// <param name="lineNo">The line number of the error</param>
        /// <param name="column">The column of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0002"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_InvalidCharacterInDirectiveName(char c, int lineNo, int column)
        { return NewError(String.Format(Resources.Error_InvalidCharacterInDirectiveName, c), lineNo, column, "OTC0002"); }
        
        /// <summary>
        /// Error that occurs when multiple "=" characters are found in a Directive Attribute definition (OTC0003)
        /// </summary>
        /// <param name="lineNo">The line number of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0003"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_MultipleEqualsCharactersInAttr(int lineNo)
        { return NewError(Resources.Error_MultipleEqualsCharactersInAttr, lineNo, -1, "OTC0003"); }
        
        /// <summary>
        /// Warning that occurs when a Directive name is not registered and could not be loaded (OTC0004)
        /// </summary>
        /// <param name="name">The name of the directive that is not registered</param>
        /// <param name="lineNo">The line number of the warning</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the warning</returns>
        /// <error number="OTC0004"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Warning_DirectiveTypeNotRegistered(string name, int lineNo)
        { return NewWarning(String.Format(Resources.Warning_DirectiveTypeNotRegistered, name), lineNo, -1, "OTC0004"); }
        
        /// <summary>
        /// Error that occurs when an attribute in a directive declaration is not recognized (OTC0005)
        /// </summary>
        /// <param name="name">The name of the attribute that is not recognized</param>
        /// <param name="lineNo">The line number of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0005"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_UnrecognizedAttribute(string name, int lineNo)
        { return NewError(String.Format(Resources.Error_UnrecognizedAttribute, name), lineNo, -1, "OTC0005"); }

        /// <summary>
        /// Error that occurs when an attribute in a directive declaration is associated with a read-only property (OTC0006)
        /// </summary>
        /// <param name="name">The name of the attribute that is associated with a read-only property</param>
        /// <param name="lineNo">The line number of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0006"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_CannotMapAttributeToReadOnlyProperty(string name, int lineNo)
        { return NewError(String.Format(Resources.Error_CannotMapAttributeToReadOnlyProperty, name), lineNo, -1, "OTC0006"); }

        /// <summary>
        /// Error that occurs when the value of an attribute could not be converted to the type expected by the property (OTC0007)
        /// </summary>
        /// <param name="name">The name of the attribute for which the value could not be converted</param>
        /// <param name="lineNo">The line number of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0007"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_FailedToConvertAttributeValue(string name, int lineNo)
        { return NewError(String.Format(Resources.Error_FailedToConvertAttributeValue, name), lineNo, -1, "OTC0007"); }
        
        /// <summary>
        /// Error that occurs when parsing cannot continue due to a large number of errors (OTC0008)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0008"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_UnableToContinueParsing()
        { return NewError(Resources.Error_UnableToContinueParsing, -1, -1, "OTC0008"); }

        /// <summary>
        /// Error that occurs when a <see cref="System.CodeDom.Compiler.CodeDomProvider"/> could not be found for the language specified in a 
        /// Template directive (OTC0009)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0009"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_LanguageMismatch()
        { return NewError(Resources.Error_LanguageMismatch, -1, -1, "OTC0009"); }
        
        /// <summary>
        /// Error that occurs when a template file does not have a Template directive (OTC0010)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0010"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_NoTemplateDirective()
        { return NewError(Resources.Error_NoTemplateDirective, -1, -1, "OTC0010"); }
        
        /// <summary>
        /// Error that occurs when a Template directive does not specify a value for the 
        /// <see cref="OpenArrow.Templating.Directives.TemplateDirective.ClassName"/> property (OTC0011)
        /// </summary>
        /// <param name="lineNo">The line number of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0011"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_NoClassNameSpecified(int lineNo)
        { return NewError(Resources.Error_NoClassNameSpecified, lineNo, -1, "OTC0011"); }
        
        /// <summary>
        /// Warning that occurs when a Template directive does not specify a value for the
        /// <see cref="OpenArrow.Templating.Directives.TemplateDirective.Namespace"/> property (OTC0012)
        /// </summary>
        /// <param name="defaultNamespace">The default namespace that was assumed</param>
        /// <param name="lineNo">The line number of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0012"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Warning_NoNamespaceSpecified(string defaultNamespace, int lineNo)
        { return NewWarning(String.Format(Resources.Warning_NoNamespaceSpecified, defaultNamespace), lineNo, -1, "OTC0012"); }
        
        /// <summary>
        /// Error that occurs when a Template directive does not specify a value for the
        /// <see cref="OpenArrow.Templating.Directives.TemplateDirective.Language"/> property (OTC0013)
        /// </summary>
        /// <param name="lineNo">The line number of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0013"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_NoLanguageSpecified(int lineNo)
        { return NewError(Resources.Error_NoLanguageSpecified, lineNo, -1, "OTC0013"); }
        
        /// <summary>
        /// Warning that occurs when there are multiple Template directives in a template file (OTC0014)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0014"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Warning_MultipleTemplateDirectives()
        { return NewWarning(Resources.Warning_MultipleTemplateDirectives, -1, -1, "OTC0014"); }

        /// <summary>
        /// Warning that occurs when the template file uses a feature that is not implemented yet (OTC0015)
        /// </summary>
        /// <param name="feature">The feature that is not implemented</param>
        /// <param name="lineNo">The line number of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0015"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)")]
        public static Problem Warning_FeatureNotImplemented(string feature, int lineNo)
        { return NewWarning(String.Format(Resources.Warning_MultipleTemplateDirectives, feature), lineNo, -1, "OTC0015"); }
        
        /// <summary>
        /// Error that occurs when compilation cannot continue due to a large number of errors (OTC0016)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0016"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_UnableToContinueCompiling()
        { return NewError(Resources.Error_UnableToContinueCompiling, -1, -1, "OTC0016"); }
        
        /// <summary>
        /// Error that occurs when a Template directive was not found in the template file (OTC0017)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0017"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_TemplateDirectiveNotFound()
        { return NewError(Resources.Error_UnableToContinueCompiling, -1, -1, "OTC0017"); }
        
        /// <summary>
        /// Error that occurs when a Template directive does not specify a value for the
        /// <see cref="OpenArrow.Templating.Directives.TemplateDirective.Language"/> property (OTC0019)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0018"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_NoLanguageSpecified()
        { return NewError(Resources.Error_NoLanguageSpecified, -1, -1, "OTC0018"); }

        /// <summary>
        /// Error that occurs when there are no valid templates to compile (OTC0019)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0019"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_NoValidTemplatesToCompile()
        { return NewError(Resources.Error_NoValidTemplatesToCompile, -1, -1, "OTC0019"); }

        /// <summary>
        /// Error that occurs when a Property directive does not specify a value for the
        /// <see cref="OpenArrow.Templating.Directives.PropertyDirective.Name"/> property (OTC0020)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0020"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_NoPropertyNameSpecified()
        { return NewError(Resources.Error_NoPropertyNameSpecified, -1, -1, "OTC0020"); }

        /// <summary>
        /// Error that occurs when a Property directive does not specify a value for the
        /// <see cref="OpenArrow.Templating.Directives.PropertyDirective.Type"/> property (OTC0021)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0021"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_NoPropertyTypeSpecified()
        { return NewError(Resources.Error_NoPropertyTypeSpecified, -1, -1, "OTC0021"); }

        /// <summary>
        /// Error that occurs when the response file for the OTC Compiler could not be parsed (OTC0022)
        /// </summary>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <error number="OTC0022"/>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
        public static Problem Error_CouldNotParseResponseFile()
        { return Problem.NewError(Resources.Error_CouldNotParseResponseFile, -1, -1, "OTC0022"); }
        
        private bool isError;
        private string message;
        private string errorNumber;
        private int line;
        private int col;

        /// <summary>
        /// Gets or sets a boolean determining if this problem is an error or a warning
        /// </summary>
        public bool IsError
        {
            get { return isError; }
            set { isError = value; }
        }

        /// <summary>
        /// Gets or sets a message attached to this problem
        /// </summary>
        public string Message
        {
            get { return message; }
            set { message = value; }
        }

        /// <summary>
        /// Gets or sets the error number associated with this problem
        /// </summary>
        public string ErrorNumber
        {
            get { return errorNumber; }
            set { errorNumber = value; }
        }

        /// <summary>
        /// Gets or sets the line number of this problem
        /// </summary>
        public int Line
        {
            get { return line; }
            set { line = value; }
        }

        /// <summary>
        /// Gets or sets the column of this problem
        /// </summary>
        public int Col
        {
            get { return col; }
            set { col = value; }
        }

        /// <summary>
        /// Constructs a new <see cref="Problem"/> object
        /// </summary>
        /// <remarks>Private constructor, use one of the overloads of <see cref="Problem.NewError"/> or <see cref="Problem.NewWarning"/></remarks>
        /// <exception cref="ArgumentException"><paramref name="message"/> is <see langword="null"/> or <see cref="String.Empty"/></exception>
        private Problem(bool isError, string message, int line, int col, string errorNumber)
        {
            if (String.IsNullOrEmpty(message))
                throw new ArgumentException(String.Format(Resources.Exception_ArgIsNullOrEmpty, "message"), "message");
            
            this.isError = isError;
            this.message = message;
            this.line = line;
            this.col = col;
            this.errorNumber = errorNumber;
        }

        /// <summary>
        /// Converts this object to a string representation
        /// </summary>
        /// <returns>A string representation of this object</returns>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object[])"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object)"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)")]
        public override string ToString()
        {
            string lineRef = String.Empty;
            if(this.Line != -1) {
                if(this.Col != -1)
                    lineRef = String.Format("({0}, {1}) ", this.Line, this.Col);
                else
                    lineRef = String.Format("({0}) ", this.Line);
            }
            return String.Format("{0}{1} {2}: {3}", lineRef, this.IsError ? "ERROR" : "WARN", this.ErrorNumber, this.Message);
        }

        /// <summary>
        /// Creates a new error
        /// </summary>
        /// <param name="message">The message associated with the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <exception cref="ArgumentException"><paramref name="message"/> is <see langword="null"/> or <see cref="String.Empty"/></exception>
        public static Problem NewError(string message) { return new Problem(true, message, -1, -1, String.Empty); }

        /// <summary>
        /// Creates a new error
        /// </summary>
        /// <param name="message">The message associated with the error</param>
        /// <param name="line">The line number of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <exception cref="ArgumentException"><paramref name="message"/> is <see langword="null"/> or <see cref="String.Empty"/></exception>
        public static Problem NewError(string message, int line) { return new Problem(true, message, line, -1, String.Empty); }

        /// <summary>
        /// Creates a new error
        /// </summary>
        /// <param name="message">The message associated with the error</param>
        /// <param name="line">The line number of the error</param>
        /// <param name="col">The column of the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <exception cref="ArgumentException"><paramref name="message"/> is <see langword="null"/> or <see cref="String.Empty"/></exception>
        public static Problem NewError(string message, int line, int col) { return new Problem(true, message, line, col, String.Empty); }

        /// <summary>
        /// Creates a new error
        /// </summary>
        /// <param name="message">The message associated with the error</param>
        /// <param name="line">The line number of the error</param>
        /// <param name="col">The column of the error</param>
        /// <param name="errorNumber">The number associated with the error</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the error</returns>
        /// <exception cref="ArgumentException"><paramref name="message"/> is <see langword="null"/> or <see cref="String.Empty"/></exception>
        public static Problem NewError(string message, int line, int col, string errorNumber) { return new Problem(true, message, line, col, errorNumber); }

        /// <summary>
        /// Creates a new warning
        /// </summary>
        /// <param name="message">The message associated with the warning</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the warning</returns>
        /// <exception cref="ArgumentException"><paramref name="message"/> is <see langword="null"/> or <see cref="String.Empty"/></exception>
        public static Problem NewWarning(string message) { return new Problem(false, message, -1, -1, String.Empty); }

        /// <summary>
        /// Creates a new warning
        /// </summary>
        /// <param name="message">The message associated with the warning</param>
        /// <param name="line">The line number of the warning</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the warning</returns>
        /// <exception cref="ArgumentException"><paramref name="message"/> is <see langword="null"/> or <see cref="String.Empty"/></exception>
        public static Problem NewWarning(string message, int line) { return new Problem(false, message, line, -1, String.Empty); }

        /// <summary>
        /// Creates a new warning
        /// </summary>
        /// <param name="message">The message associated with the warning</param>
        /// <param name="line">The line number of the warning</param>
        /// <param name="col">The column of the warning</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the warning</returns>
        /// <exception cref="ArgumentException"><paramref name="message"/> is <see langword="null"/> or <see cref="String.Empty"/></exception>
        public static Problem NewWarning(string message, int line, int col) { return new Problem(false, message, line, col, String.Empty); }

        /// <summary>
        /// Creates a new warning
        /// </summary>
        /// <param name="message">The message associated with the warning</param>
        /// <param name="line">The line number of the warning</param>
        /// <param name="col">The column of the warning</param>
        /// <param name="errorNumber">The number associated with the warning</param>
        /// <returns>A <see cref="OpenArrow.Templating.Problem"/> object representing the warning</returns>
        /// <exception cref="ArgumentException"><paramref name="message"/> is <see langword="null"/> or <see cref="String.Empty"/></exception>
        public static Problem NewWarning(string message, int line, int col, string errorNumber) { return new Problem(false, message, line, col, errorNumber); }
 
    }
}
